using System;
using System.Collections.Generic;
using UnityEngine;

public class LevelData : ScriptableObject
{
	[Serializable]
	public class BallData
	{
		public int ID;

		public Vector3 Position;

		public BallType Type;

		[HideInInspector]
		public Rect pRect;

		public BallData(int _ID, Vector3 _Position, Rect _pRect, BallType _type)
		{
			ID = _ID;
			Position = _Position;
			pRect = _pRect;
			Type = _type;
		}
	}

	[Serializable]
	public class OtherObjectDatas
	{
		public int ID;

		public Vector3 Position;

		public Vector3 Rotation;

		[HideInInspector]
		public Rect pRect;

		public OtherObjectDatas(int _ID, Vector3 _Position, Vector3 _Rotation, Rect _pRect)
		{
			ID = _ID;
			Position = _Position;
			Rotation = _Rotation;
			pRect = _pRect;
		}
	}

	public string FileName;

	[SerializeField]
	private bool m_SpecificPocket;

	[SerializeField]
	private PocketIndexes m_BlockPocketList;

	[SerializeField]
	private PocketIndexes m_StartPunishmentPocket;

	[SerializeField]
	private PocketIndexes m_StartRewardPocket;

	[SerializeField]
	private int m_ShotCount;

	[SerializeField]
	private int m_DescriptionID;

	[SerializeField]
	private BallData m_CueballData;

	[SerializeField]
	private List<BallData> m_BallDatas = new List<BallData>();

	[SerializeField]
	private List<OtherObjectDatas> m_OtherObjectsPosition = new List<OtherObjectDatas>();

	public List<BallData> ballDatas => m_BallDatas;

	public List<OtherObjectDatas> OtherObjectsPosition => m_OtherObjectsPosition;

	public BallData cueBallData
	{
		get
		{
			return m_CueballData;
		}
		set
		{
			m_CueballData = value;
		}
	}

	public PocketIndexes BlockPockets
	{
		get
		{
			return m_BlockPocketList;
		}
		set
		{
			m_BlockPocketList = value;
		}
	}

	public PocketIndexes StartPunishmentPocket
	{
		get
		{
			return m_StartPunishmentPocket;
		}
		set
		{
			m_StartPunishmentPocket = value;
		}
	}

	public PocketIndexes StartRewardPocket
	{
		get
		{
			return m_StartRewardPocket;
		}
		set
		{
			m_StartRewardPocket = value;
		}
	}

	public int shotCount
	{
		get
		{
			return (m_ShotCount <= 1) ? m_ShotCount : (m_ShotCount - 1);
		}
		set
		{
			m_ShotCount = value;
		}
	}

	public int DescriptionID
	{
		get
		{
			return m_DescriptionID;
		}
		set
		{
			m_DescriptionID = value;
		}
	}

	public bool SpecificPocket
	{
		get
		{
			return m_SpecificPocket;
		}
		set
		{
			m_SpecificPocket = value;
		}
	}

	public override bool Equals(object o)
	{
		if (!(o is LevelData) || o == null)
		{
			return false;
		}
		LevelData levelData = (LevelData)o;
		if (levelData.FileName.CompareTo(FileName) == 0)
		{
			return true;
		}
		return false;
	}

	public override int GetHashCode()
	{
		return FileName.GetHashCode();
	}
}
